@react-fabric/lexical 1.0.0-beta.9 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/{src/editor/Lexical.module.css → css/_lexical.css} +79 -13
  2. package/css/styles.css +24 -0
  3. package/dist/cjs/{packages/lexical/src/editor → editor}/LexicalEditor.js +98 -45
  4. package/dist/cjs/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +147 -140
  5. package/dist/cjs/i18n/ar/lexical.json.js +30 -0
  6. package/dist/cjs/i18n/en/lexical.json.js +30 -0
  7. package/{src/plugins/StickyPlugin.ts → dist/cjs/i18n/index.js} +10 -15
  8. package/dist/cjs/index.js +36 -0
  9. package/dist/cjs/plugins/CommentPlugin.js +481 -0
  10. package/dist/cjs/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +17 -20
  11. package/dist/cjs/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +58 -37
  12. package/dist/esm/{packages/lexical/src/editor → editor}/LexicalEditor.js +101 -48
  13. package/dist/esm/{packages/lexical/src/hooks → hooks}/useFormatWatcher.js +95 -88
  14. package/dist/esm/i18n/ar/lexical.json.js +25 -0
  15. package/dist/esm/i18n/en/lexical.json.js +25 -0
  16. package/dist/esm/i18n/index.js +33 -0
  17. package/dist/esm/index.js +34 -0
  18. package/dist/esm/plugins/CommentPlugin.js +481 -0
  19. package/dist/esm/{packages/lexical/src/plugins → plugins}/DraggableBlockPlugin.js +15 -18
  20. package/dist/esm/{packages/lexical/src/plugins → plugins}/ToolbarPlugin.js +59 -38
  21. package/dist/types/editor/LexicalEditor.d.ts +33 -4
  22. package/dist/types/hooks/useFormatWatcher.d.ts +7 -4
  23. package/dist/types/i18n/index.d.ts +1 -0
  24. package/dist/types/index.d.ts +27 -0
  25. package/dist/types/plugins/CommentPlugin.d.ts +5 -0
  26. package/dist/types/plugins/DraggableBlockPlugin.d.ts +3 -2
  27. package/dist/types/plugins/ToolbarPlugin.d.ts +1 -1
  28. package/dist/types/utils/index.d.ts +3 -6
  29. package/package.json +18 -18
  30. package/src/editor/LexicalEditor.tsx +95 -55
  31. package/src/hooks/useFormatWatcher.ts +50 -74
  32. package/src/i18n/ar/lexical.json +18 -0
  33. package/src/i18n/en/lexical.json +18 -0
  34. package/src/i18n/index.ts +28 -0
  35. package/src/index.ts +24 -17
  36. package/src/plugins/CommentPlugin.tsx +523 -0
  37. package/src/plugins/DraggableBlockPlugin.tsx +23 -68
  38. package/src/plugins/ToolbarPlugin.tsx +83 -131
  39. package/src/utils/index.ts +12 -108
  40. package/dist/cjs/_virtual/prism.js +0 -5
  41. package/dist/cjs/editor/Lexical.module.css +0 -1
  42. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -432
  43. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -21
  44. package/dist/cjs/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -27
  45. package/dist/cjs/node_modules/@lexical/code/LexicalCode.dev.js +0 -1139
  46. package/dist/cjs/node_modules/@lexical/code/LexicalCode.js +0 -25
  47. package/dist/cjs/node_modules/@lexical/code/LexicalCode.prod.js +0 -50
  48. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.dev.js +0 -245
  49. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.js +0 -19
  50. package/dist/cjs/node_modules/@lexical/html/LexicalHtml.prod.js +0 -18
  51. package/dist/cjs/node_modules/@lexical/link/LexicalLink.dev.js +0 -471
  52. package/dist/cjs/node_modules/@lexical/link/LexicalLink.js +0 -17
  53. package/dist/cjs/node_modules/@lexical/link/LexicalLink.prod.js +0 -24
  54. package/dist/cjs/node_modules/@lexical/list/LexicalList.dev.js +0 -1275
  55. package/dist/cjs/node_modules/@lexical/list/LexicalList.js +0 -29
  56. package/dist/cjs/node_modules/@lexical/list/LexicalList.prod.js +0 -29
  57. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -789
  58. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.js +0 -29
  59. package/dist/cjs/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -26
  60. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -976
  61. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.js +0 -35
  62. package/dist/cjs/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -35
  63. package/dist/cjs/node_modules/@lexical/table/LexicalTable.dev.js +0 -2792
  64. package/dist/cjs/node_modules/@lexical/table/LexicalTable.js +0 -23
  65. package/dist/cjs/node_modules/@lexical/table/LexicalTable.prod.js +0 -55
  66. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -888
  67. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.js +0 -35
  68. package/dist/cjs/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -66
  69. package/dist/cjs/node_modules/@mdi/js/mdi.js +0 -8
  70. package/dist/cjs/node_modules/prismjs/components/prism-c.js +0 -82
  71. package/dist/cjs/node_modules/prismjs/components/prism-clike.js +0 -33
  72. package/dist/cjs/node_modules/prismjs/components/prism-cpp.js +0 -101
  73. package/dist/cjs/node_modules/prismjs/components/prism-css.js +0 -66
  74. package/dist/cjs/node_modules/prismjs/components/prism-java.js +0 -126
  75. package/dist/cjs/node_modules/prismjs/components/prism-javascript.js +0 -174
  76. package/dist/cjs/node_modules/prismjs/components/prism-markdown.js +0 -417
  77. package/dist/cjs/node_modules/prismjs/components/prism-markup.js +0 -188
  78. package/dist/cjs/node_modules/prismjs/components/prism-objectivec.js +0 -14
  79. package/dist/cjs/node_modules/prismjs/components/prism-powershell.js +0 -60
  80. package/dist/cjs/node_modules/prismjs/components/prism-python.js +0 -67
  81. package/dist/cjs/node_modules/prismjs/components/prism-rust.js +0 -130
  82. package/dist/cjs/node_modules/prismjs/components/prism-sql.js +0 -34
  83. package/dist/cjs/node_modules/prismjs/components/prism-swift.js +0 -150
  84. package/dist/cjs/node_modules/prismjs/components/prism-typescript.js +0 -62
  85. package/dist/cjs/node_modules/prismjs/prism.js +0 -1951
  86. package/dist/cjs/packages/lexical/src/components/StickyComponent.js +0 -221
  87. package/dist/cjs/packages/lexical/src/index.js +0 -7
  88. package/dist/cjs/packages/lexical/src/nodes/StickyNode.js +0 -218
  89. package/dist/cjs/packages/lexical/src/plugins/StickyPlugin.js +0 -20
  90. package/dist/esm/_virtual/prism.js +0 -5
  91. package/dist/esm/editor/Lexical.module.css +0 -1
  92. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.dev.js +0 -423
  93. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.js +0 -19
  94. package/dist/esm/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -18
  95. package/dist/esm/node_modules/@lexical/code/LexicalCode.dev.js +0 -1121
  96. package/dist/esm/node_modules/@lexical/code/LexicalCode.js +0 -21
  97. package/dist/esm/node_modules/@lexical/code/LexicalCode.prod.js +0 -32
  98. package/dist/esm/node_modules/@lexical/html/LexicalHtml.dev.js +0 -244
  99. package/dist/esm/node_modules/@lexical/html/LexicalHtml.js +0 -18
  100. package/dist/esm/node_modules/@lexical/html/LexicalHtml.prod.js +0 -17
  101. package/dist/esm/node_modules/@lexical/link/LexicalLink.dev.js +0 -463
  102. package/dist/esm/node_modules/@lexical/link/LexicalLink.js +0 -17
  103. package/dist/esm/node_modules/@lexical/link/LexicalLink.prod.js +0 -16
  104. package/dist/esm/node_modules/@lexical/list/LexicalList.dev.js +0 -1262
  105. package/dist/esm/node_modules/@lexical/list/LexicalList.js +0 -23
  106. package/dist/esm/node_modules/@lexical/list/LexicalList.prod.js +0 -16
  107. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.dev.js +0 -781
  108. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.js +0 -23
  109. package/dist/esm/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -18
  110. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.dev.js +0 -957
  111. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.js +0 -26
  112. package/dist/esm/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -16
  113. package/dist/esm/node_modules/@lexical/table/LexicalTable.dev.js +0 -2754
  114. package/dist/esm/node_modules/@lexical/table/LexicalTable.js +0 -20
  115. package/dist/esm/node_modules/@lexical/table/LexicalTable.prod.js +0 -17
  116. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.dev.js +0 -839
  117. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.js +0 -26
  118. package/dist/esm/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -17
  119. package/dist/esm/node_modules/@mdi/js/mdi.js +0 -7
  120. package/dist/esm/node_modules/prismjs/components/prism-c.js +0 -82
  121. package/dist/esm/node_modules/prismjs/components/prism-clike.js +0 -33
  122. package/dist/esm/node_modules/prismjs/components/prism-cpp.js +0 -101
  123. package/dist/esm/node_modules/prismjs/components/prism-css.js +0 -66
  124. package/dist/esm/node_modules/prismjs/components/prism-java.js +0 -126
  125. package/dist/esm/node_modules/prismjs/components/prism-javascript.js +0 -174
  126. package/dist/esm/node_modules/prismjs/components/prism-markdown.js +0 -417
  127. package/dist/esm/node_modules/prismjs/components/prism-markup.js +0 -188
  128. package/dist/esm/node_modules/prismjs/components/prism-objectivec.js +0 -14
  129. package/dist/esm/node_modules/prismjs/components/prism-powershell.js +0 -60
  130. package/dist/esm/node_modules/prismjs/components/prism-python.js +0 -67
  131. package/dist/esm/node_modules/prismjs/components/prism-rust.js +0 -130
  132. package/dist/esm/node_modules/prismjs/components/prism-sql.js +0 -34
  133. package/dist/esm/node_modules/prismjs/components/prism-swift.js +0 -150
  134. package/dist/esm/node_modules/prismjs/components/prism-typescript.js +0 -62
  135. package/dist/esm/node_modules/prismjs/prism.js +0 -1951
  136. package/dist/esm/packages/lexical/src/components/StickyComponent.js +0 -221
  137. package/dist/esm/packages/lexical/src/index.js +0 -3
  138. package/dist/esm/packages/lexical/src/nodes/StickyNode.js +0 -216
  139. package/dist/esm/packages/lexical/src/plugins/StickyPlugin.js +0 -20
  140. package/dist/types/components/StickyComponent.d.ts +0 -9
  141. package/dist/types/nodes/StickyNode.d.ts +0 -35
  142. package/dist/types/plugins/StickyPlugin.d.ts +0 -1
  143. package/src/components/StickyComponent.tsx +0 -271
  144. package/src/nodes/StickyNode.tsx +0 -249
  145. /package/dist/cjs/{packages/lexical/src/editor → editor}/theme.js +0 -0
  146. /package/dist/cjs/{packages/lexical/src/utils → utils}/index.js +0 -0
  147. /package/dist/esm/{packages/lexical/src/editor → editor}/theme.js +0 -0
  148. /package/dist/esm/{packages/lexical/src/utils → utils}/index.js +0 -0
@@ -1,188 +0,0 @@
1
- 'use strict';
2
-
3
- Prism.languages.markup = {
4
- 'comment': {
5
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
6
- greedy: true
7
- },
8
- 'prolog': {
9
- pattern: /<\?[\s\S]+?\?>/,
10
- greedy: true
11
- },
12
- 'doctype': {
13
- // https://www.w3.org/TR/xml/#NT-doctypedecl
14
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
15
- greedy: true,
16
- inside: {
17
- 'internal-subset': {
18
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
19
- lookbehind: true,
20
- greedy: true,
21
- inside: null // see below
22
- },
23
- 'string': {
24
- pattern: /"[^"]*"|'[^']*'/,
25
- greedy: true
26
- },
27
- 'punctuation': /^<!|>$|[[\]]/,
28
- 'doctype-tag': /^DOCTYPE/i,
29
- 'name': /[^\s<>'"]+/
30
- }
31
- },
32
- 'cdata': {
33
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
34
- greedy: true
35
- },
36
- 'tag': {
37
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
38
- greedy: true,
39
- inside: {
40
- 'tag': {
41
- pattern: /^<\/?[^\s>\/]+/,
42
- inside: {
43
- 'punctuation': /^<\/?/,
44
- 'namespace': /^[^\s>\/:]+:/
45
- }
46
- },
47
- 'special-attr': [],
48
- 'attr-value': {
49
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
50
- inside: {
51
- 'punctuation': [
52
- {
53
- pattern: /^=/,
54
- alias: 'attr-equals'
55
- },
56
- {
57
- pattern: /^(\s*)["']|["']$/,
58
- lookbehind: true
59
- }
60
- ]
61
- }
62
- },
63
- 'punctuation': /\/?>/,
64
- 'attr-name': {
65
- pattern: /[^\s>\/]+/,
66
- inside: {
67
- 'namespace': /^[^\s>\/:]+:/
68
- }
69
- }
70
-
71
- }
72
- },
73
- 'entity': [
74
- {
75
- pattern: /&[\da-z]{1,8};/i,
76
- alias: 'named-entity'
77
- },
78
- /&#x?[\da-f]{1,8};/i
79
- ]
80
- };
81
-
82
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
83
- Prism.languages.markup['entity'];
84
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
85
-
86
- // Plugin to make entity title show the real entity, idea by Roman Komarov
87
- Prism.hooks.add('wrap', function (env) {
88
-
89
- if (env.type === 'entity') {
90
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
91
- }
92
- });
93
-
94
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
95
- /**
96
- * Adds an inlined language to markup.
97
- *
98
- * An example of an inlined language is CSS with `<style>` tags.
99
- *
100
- * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
101
- * case insensitive.
102
- * @param {string} lang The language key.
103
- * @example
104
- * addInlined('style', 'css');
105
- */
106
- value: function addInlined(tagName, lang) {
107
- var includedCdataInside = {};
108
- includedCdataInside['language-' + lang] = {
109
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
110
- lookbehind: true,
111
- inside: Prism.languages[lang]
112
- };
113
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
114
-
115
- var inside = {
116
- 'included-cdata': {
117
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
118
- inside: includedCdataInside
119
- }
120
- };
121
- inside['language-' + lang] = {
122
- pattern: /[\s\S]+/,
123
- inside: Prism.languages[lang]
124
- };
125
-
126
- var def = {};
127
- def[tagName] = {
128
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
129
- lookbehind: true,
130
- greedy: true,
131
- inside: inside
132
- };
133
-
134
- Prism.languages.insertBefore('markup', 'cdata', def);
135
- }
136
- });
137
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
138
- /**
139
- * Adds an pattern to highlight languages embedded in HTML attributes.
140
- *
141
- * An example of an inlined language is CSS with `style` attributes.
142
- *
143
- * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
144
- * case insensitive.
145
- * @param {string} lang The language key.
146
- * @example
147
- * addAttribute('style', 'css');
148
- */
149
- value: function (attrName, lang) {
150
- Prism.languages.markup.tag.inside['special-attr'].push({
151
- pattern: RegExp(
152
- /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
153
- 'i'
154
- ),
155
- lookbehind: true,
156
- inside: {
157
- 'attr-name': /^[^\s=]+/,
158
- 'attr-value': {
159
- pattern: /=[\s\S]+/,
160
- inside: {
161
- 'value': {
162
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
163
- lookbehind: true,
164
- alias: [lang, 'language-' + lang],
165
- inside: Prism.languages[lang]
166
- },
167
- 'punctuation': [
168
- {
169
- pattern: /^=/,
170
- alias: 'attr-equals'
171
- },
172
- /"|'/
173
- ]
174
- }
175
- }
176
- }
177
- });
178
- }
179
- });
180
-
181
- Prism.languages.html = Prism.languages.markup;
182
- Prism.languages.mathml = Prism.languages.markup;
183
- Prism.languages.svg = Prism.languages.markup;
184
-
185
- Prism.languages.xml = Prism.languages.extend('markup', {});
186
- Prism.languages.ssml = Prism.languages.xml;
187
- Prism.languages.atom = Prism.languages.xml;
188
- Prism.languages.rss = Prism.languages.xml;
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- Prism.languages.objectivec = Prism.languages.extend('c', {
4
- 'string': {
5
- pattern: /@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,
6
- greedy: true
7
- },
8
- 'keyword': /\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,
9
- 'operator': /-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/
10
- });
11
-
12
- delete Prism.languages.objectivec['class-name'];
13
-
14
- Prism.languages.objc = Prism.languages.objectivec;
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- (function (Prism) {
4
-
5
- var powershell = Prism.languages.powershell = {
6
- 'comment': [
7
- {
8
- pattern: /(^|[^`])<#[\s\S]*?#>/,
9
- lookbehind: true
10
- },
11
- {
12
- pattern: /(^|[^`])#.*/,
13
- lookbehind: true
14
- }
15
- ],
16
- 'string': [
17
- {
18
- pattern: /"(?:`[\s\S]|[^`"])*"/,
19
- greedy: true,
20
- inside: null // see below
21
- },
22
- {
23
- pattern: /'(?:[^']|'')*'/,
24
- greedy: true
25
- }
26
- ],
27
- // Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices
28
- // Supports two levels of nested brackets (e.g. `[OutputType([System.Collections.Generic.List[int]])]`)
29
- 'namespace': /\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,
30
- 'boolean': /\$(?:false|true)\b/i,
31
- 'variable': /\$\w+\b/,
32
- // Cmdlets and aliases. Aliases should come last, otherwise "write" gets preferred over "write-host" for example
33
- // Get-Command | ?{ $_.ModuleName -match "Microsoft.PowerShell.(Util|Core|Management)" }
34
- // Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match "Microsoft.PowerShell.(Util|Core|Management)" }
35
- 'function': [
36
- /\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,
37
- /\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i
38
- ],
39
- // per http://technet.microsoft.com/en-us/library/hh847744.aspx
40
- 'keyword': /\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,
41
- 'operator': {
42
- pattern: /(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,
43
- lookbehind: true
44
- },
45
- 'punctuation': /[|{}[\];(),.]/
46
- };
47
-
48
- // Variable interpolation inside strings, and nested expressions
49
- powershell.string[0].inside = {
50
- 'function': {
51
- // Allow for one level of nesting
52
- pattern: /(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,
53
- lookbehind: true,
54
- inside: powershell
55
- },
56
- 'boolean': powershell.boolean,
57
- 'variable': powershell.variable,
58
- };
59
-
60
- }(Prism));
@@ -1,67 +0,0 @@
1
- 'use strict';
2
-
3
- Prism.languages.python = {
4
- 'comment': {
5
- pattern: /(^|[^\\])#.*/,
6
- lookbehind: true,
7
- greedy: true
8
- },
9
- 'string-interpolation': {
10
- pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
11
- greedy: true,
12
- inside: {
13
- 'interpolation': {
14
- // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
15
- pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
16
- lookbehind: true,
17
- inside: {
18
- 'format-spec': {
19
- pattern: /(:)[^:(){}]+(?=\}$)/,
20
- lookbehind: true
21
- },
22
- 'conversion-option': {
23
- pattern: /![sra](?=[:}]$)/,
24
- alias: 'punctuation'
25
- },
26
- rest: null
27
- }
28
- },
29
- 'string': /[\s\S]+/
30
- }
31
- },
32
- 'triple-quoted-string': {
33
- pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
34
- greedy: true,
35
- alias: 'string'
36
- },
37
- 'string': {
38
- pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
39
- greedy: true
40
- },
41
- 'function': {
42
- pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
43
- lookbehind: true
44
- },
45
- 'class-name': {
46
- pattern: /(\bclass\s+)\w+/i,
47
- lookbehind: true
48
- },
49
- 'decorator': {
50
- pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
51
- lookbehind: true,
52
- alias: ['annotation', 'punctuation'],
53
- inside: {
54
- 'punctuation': /\./
55
- }
56
- },
57
- 'keyword': /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
58
- 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
59
- 'boolean': /\b(?:False|None|True)\b/,
60
- 'number': /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
61
- 'operator': /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
62
- 'punctuation': /[{}[\];(),.:]/
63
- };
64
-
65
- Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;
66
-
67
- Prism.languages.py = Prism.languages.python;
@@ -1,130 +0,0 @@
1
- 'use strict';
2
-
3
- (function (Prism) {
4
-
5
- var multilineComment = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source;
6
- for (var i = 0; i < 2; i++) {
7
- // support 4 levels of nested comments
8
- multilineComment = multilineComment.replace(/<self>/g, function () { return multilineComment; });
9
- }
10
- multilineComment = multilineComment.replace(/<self>/g, function () { return /[^\s\S]/.source; });
11
-
12
-
13
- Prism.languages.rust = {
14
- 'comment': [
15
- {
16
- pattern: RegExp(/(^|[^\\])/.source + multilineComment),
17
- lookbehind: true,
18
- greedy: true
19
- },
20
- {
21
- pattern: /(^|[^\\:])\/\/.*/,
22
- lookbehind: true,
23
- greedy: true
24
- }
25
- ],
26
- 'string': {
27
- pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,
28
- greedy: true
29
- },
30
- 'char': {
31
- pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,
32
- greedy: true
33
- },
34
- 'attribute': {
35
- pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,
36
- greedy: true,
37
- alias: 'attr-name',
38
- inside: {
39
- 'string': null // see below
40
- }
41
- },
42
-
43
- // Closure params should not be confused with bitwise OR |
44
- 'closure-params': {
45
- pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,
46
- lookbehind: true,
47
- greedy: true,
48
- inside: {
49
- 'closure-punctuation': {
50
- pattern: /^\||\|$/,
51
- alias: 'punctuation'
52
- },
53
- rest: null // see below
54
- }
55
- },
56
-
57
- 'lifetime-annotation': {
58
- pattern: /'\w+/,
59
- alias: 'symbol'
60
- },
61
-
62
- 'fragment-specifier': {
63
- pattern: /(\$\w+:)[a-z]+/,
64
- lookbehind: true,
65
- alias: 'punctuation'
66
- },
67
- 'variable': /\$\w+/,
68
-
69
- 'function-definition': {
70
- pattern: /(\bfn\s+)\w+/,
71
- lookbehind: true,
72
- alias: 'function'
73
- },
74
- 'type-definition': {
75
- pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/,
76
- lookbehind: true,
77
- alias: 'class-name'
78
- },
79
- 'module-declaration': [
80
- {
81
- pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,
82
- lookbehind: true,
83
- alias: 'namespace'
84
- },
85
- {
86
- pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,
87
- lookbehind: true,
88
- alias: 'namespace',
89
- inside: {
90
- 'punctuation': /::/
91
- }
92
- }
93
- ],
94
- 'keyword': [
95
- // https://github.com/rust-lang/reference/blob/master/src/keywords.md
96
- /\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,
97
- // primitives and str
98
- // https://doc.rust-lang.org/stable/rust-by-example/primitives.html
99
- /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/
100
- ],
101
-
102
- // functions can technically start with an upper-case letter, but this will introduce a lot of false positives
103
- // and Rust's naming conventions recommend snake_case anyway.
104
- // https://doc.rust-lang.org/1.0.0/style/style/naming/README.html
105
- 'function': /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,
106
- 'macro': {
107
- pattern: /\b\w+!/,
108
- alias: 'property'
109
- },
110
- 'constant': /\b[A-Z_][A-Z_\d]+\b/,
111
- 'class-name': /\b[A-Z]\w*\b/,
112
-
113
- 'namespace': {
114
- pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,
115
- inside: {
116
- 'punctuation': /::/
117
- }
118
- },
119
-
120
- // Hex, oct, bin, dec numbers with visual separators and type suffix
121
- 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,
122
- 'boolean': /\b(?:false|true)\b/,
123
- 'punctuation': /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
124
- 'operator': /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
125
- };
126
-
127
- Prism.languages.rust['closure-params'].inside.rest = Prism.languages.rust;
128
- Prism.languages.rust['attribute'].inside['string'] = Prism.languages.rust['string'];
129
-
130
- }(Prism));
@@ -1,34 +0,0 @@
1
- 'use strict';
2
-
3
- Prism.languages.sql = {
4
- 'comment': {
5
- pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,
6
- lookbehind: true
7
- },
8
- 'variable': [
9
- {
10
- pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,
11
- greedy: true
12
- },
13
- /@[\w.$]+/
14
- ],
15
- 'string': {
16
- pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
17
- greedy: true,
18
- lookbehind: true
19
- },
20
- 'identifier': {
21
- pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,
22
- greedy: true,
23
- lookbehind: true,
24
- inside: {
25
- 'punctuation': /^`|`$/
26
- }
27
- },
28
- 'function': /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, // Should we highlight user defined functions too?
29
- 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,
30
- 'boolean': /\b(?:FALSE|NULL|TRUE)\b/i,
31
- 'number': /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,
32
- 'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
33
- 'punctuation': /[;[\]()`,.]/
34
- };
@@ -1,150 +0,0 @@
1
- 'use strict';
2
-
3
- Prism.languages.swift = {
4
- 'comment': {
5
- // Nested comments are supported up to 2 levels
6
- pattern: /(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,
7
- lookbehind: true,
8
- greedy: true
9
- },
10
- 'string-literal': [
11
- // https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html
12
- {
13
- pattern: RegExp(
14
- /(^|[^"#])/.source
15
- + '(?:'
16
- // single-line string
17
- + /"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source
18
- + '|'
19
- // multi-line string
20
- + /"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source
21
- + ')'
22
- + /(?!["#])/.source
23
- ),
24
- lookbehind: true,
25
- greedy: true,
26
- inside: {
27
- 'interpolation': {
28
- pattern: /(\\\()(?:[^()]|\([^()]*\))*(?=\))/,
29
- lookbehind: true,
30
- inside: null // see below
31
- },
32
- 'interpolation-punctuation': {
33
- pattern: /^\)|\\\($/,
34
- alias: 'punctuation'
35
- },
36
- 'punctuation': /\\(?=[\r\n])/,
37
- 'string': /[\s\S]+/
38
- }
39
- },
40
- {
41
- pattern: RegExp(
42
- /(^|[^"#])(#+)/.source
43
- + '(?:'
44
- // single-line string
45
- + /"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source
46
- + '|'
47
- // multi-line string
48
- + /"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source
49
- + ')'
50
- + '\\2'
51
- ),
52
- lookbehind: true,
53
- greedy: true,
54
- inside: {
55
- 'interpolation': {
56
- pattern: /(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,
57
- lookbehind: true,
58
- inside: null // see below
59
- },
60
- 'interpolation-punctuation': {
61
- pattern: /^\)|\\#+\($/,
62
- alias: 'punctuation'
63
- },
64
- 'string': /[\s\S]+/
65
- }
66
- },
67
- ],
68
-
69
- 'directive': {
70
- // directives with conditions
71
- pattern: RegExp(
72
- /#/.source
73
- + '(?:'
74
- + (
75
- /(?:elseif|if)\b/.source
76
- + '(?:[ \t]*'
77
- // This regex is a little complex. It's equivalent to this:
78
- // (?:![ \t]*)?(?:\b\w+\b(?:[ \t]*<round>)?|<round>)(?:[ \t]*(?:&&|\|\|))?
79
- // where <round> is a general parentheses expression.
80
- + /(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source
81
- + ')+'
82
- )
83
- + '|'
84
- + /(?:else|endif)\b/.source
85
- + ')'
86
- ),
87
- alias: 'property',
88
- inside: {
89
- 'directive-name': /^#\w+/,
90
- 'boolean': /\b(?:false|true)\b/,
91
- 'number': /\b\d+(?:\.\d+)*\b/,
92
- 'operator': /!|&&|\|\||[<>]=?/,
93
- 'punctuation': /[(),]/
94
- }
95
- },
96
- 'literal': {
97
- pattern: /#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,
98
- alias: 'constant'
99
- },
100
- 'other-directive': {
101
- pattern: /#\w+\b/,
102
- alias: 'property'
103
- },
104
-
105
- 'attribute': {
106
- pattern: /@\w+/,
107
- alias: 'atrule'
108
- },
109
-
110
- 'function-definition': {
111
- pattern: /(\bfunc\s+)\w+/,
112
- lookbehind: true,
113
- alias: 'function'
114
- },
115
- 'label': {
116
- // https://docs.swift.org/swift-book/LanguageGuide/ControlFlow.html#ID141
117
- pattern: /\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,
118
- lookbehind: true,
119
- alias: 'important'
120
- },
121
-
122
- 'keyword': /\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,
123
- 'boolean': /\b(?:false|true)\b/,
124
- 'nil': {
125
- pattern: /\bnil\b/,
126
- alias: 'constant'
127
- },
128
-
129
- 'short-argument': /\$\d+\b/,
130
- 'omit': {
131
- pattern: /\b_\b/,
132
- alias: 'keyword'
133
- },
134
- 'number': /\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,
135
-
136
- // A class name must start with an upper-case letter and be either 1 letter long or contain a lower-case letter.
137
- 'class-name': /\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,
138
- 'function': /\b[a-z_]\w*(?=\s*\()/i,
139
- 'constant': /\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,
140
-
141
- // Operators are generic in Swift. Developers can even create new operators (e.g. +++).
142
- // https://docs.swift.org/swift-book/ReferenceManual/zzSummaryOfTheGrammar.html#ID481
143
- // This regex only supports ASCII operators.
144
- 'operator': /[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,
145
- 'punctuation': /[{}[\]();,.:\\]/
146
- };
147
-
148
- Prism.languages.swift['string-literal'].forEach(function (rule) {
149
- rule.inside['interpolation'].inside = Prism.languages.swift;
150
- });